]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/keyboard: Allow switching input source in the message tray
authorRui Matos <tiagomatos@gmail.com>
Fri, 29 Mar 2013 22:19:02 +0000 (23:19 +0100)
committerRui Matos <tiagomatos@gmail.com>
Mon, 27 May 2013 12:05:53 +0000 (14:05 +0200)
We still can't show a popup switcher in the message tray but we can at
least degrade gracefully and advance to the next input source.

https://bugzilla.gnome.org/show_bug.cgi?id=697009

js/ui/status/keyboard.js

index 903afe2dc5b870ffa953b9a9f16b90623f84543a..2c301750885ce82364e7fe1b1fbaafe4209e2132 100644 (file)
@@ -364,14 +364,14 @@ const InputSourceIndicator = new Lang.Class({
             Main.wm.addKeybinding('switch-input-source',
                                   new Gio.Settings({ schema: "org.gnome.desktop.wm.keybindings" }),
                                   Meta.KeyBindingFlags.REVERSES,
-                                  Shell.KeyBindingMode.ALL & ~Shell.KeyBindingMode.MESSAGE_TRAY,
+                                  Shell.KeyBindingMode.ALL,
                                   Lang.bind(this, this._switchInputSource));
         this._keybindingActionBackward =
             Main.wm.addKeybinding('switch-input-source-backward',
                                   new Gio.Settings({ schema: "org.gnome.desktop.wm.keybindings" }),
                                   Meta.KeyBindingFlags.REVERSES |
                                   Meta.KeyBindingFlags.REVERSED,
-                                  Shell.KeyBindingMode.ALL & ~Shell.KeyBindingMode.MESSAGE_TRAY,
+                                  Shell.KeyBindingMode.ALL,
                                   Lang.bind(this, this._switchInputSource));
         this._settings = new Gio.Settings({ schema: DESKTOP_INPUT_SOURCES_SCHEMA });
         this._settings.connect('changed::' + KEY_CURRENT_INPUT_SOURCE, Lang.bind(this, this._currentInputSourceChanged));
@@ -459,6 +459,17 @@ const InputSourceIndicator = new Lang.Class({
         if (this._mruSources.length < 2)
             return;
 
+        // HACK: Fall back on simple input source switching since we
+        // can't show a popup switcher while a GrabHelper grab is in
+        // effect without considerable work to consolidate the usage
+        // of pushModal/popModal and grabHelper. See
+        // https://bugzilla.gnome.org/show_bug.cgi?id=695143 .
+        if (Main.keybindingMode == Shell.KeyBindingMode.MESSAGE_TRAY ||
+            Main.keybindingMode == Shell.KeyBindingMode.TOPBAR_POPUP) {
+            this._modifiersSwitcher();
+            return;
+        }
+
         let popup = new InputSourcePopup(this._mruSources, this._keybindingAction, this._keybindingActionBackward);
         let modifiers = binding.get_modifiers();
         let backwards = modifiers & Meta.VirtualModifier.SHIFT_MASK;